package com.ruoyi.purchase.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.purchase.mapper.PurchaseMapper;
import com.ruoyi.purchase.domain.Purchase;
import com.ruoyi.purchase.service.IPurchaseService;

/**
 * 商品进货Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-26
 */
@Service
public class PurchaseServiceImpl implements IPurchaseService 
{
    @Autowired
    private PurchaseMapper purchaseMapper;

    /**
     * 查询商品进货
     * 
     * @param id 商品进货主键
     * @return 商品进货
     */
    @Override
    public Purchase selectPurchaseById(Integer id)
    {
        return purchaseMapper.selectPurchaseById(id);
    }

    /**
     * 查询商品进货列表
     * 
     * @param purchase 商品进货
     * @return 商品进货
     */
    @Override
    public List<Purchase> selectPurchaseList(Purchase purchase)
    {
        return purchaseMapper.selectPurchaseList(purchase);
    }

    /**
     * 新增商品进货
     * 
     * @param purchase 商品进货
     * @return 结果
     */
    @Override
    public int insertPurchase(Purchase purchase)
    {
        return purchaseMapper.insertPurchase(purchase);
    }

    /**
     * 修改商品进货
     * 
     * @param purchase 商品进货
     * @return 结果
     */
    @Override
    public int updatePurchase(Purchase purchase)
    {
        return purchaseMapper.updatePurchase(purchase);
    }

    /**
     * 批量删除商品进货
     * 
     * @param ids 需要删除的商品进货主键
     * @return 结果
     */
    @Override
    public int deletePurchaseByIds(Integer[] ids)
    {
        return purchaseMapper.deletePurchaseByIds(ids);
    }

    /**
     * 删除商品进货信息
     * 
     * @param id 商品进货主键
     * @return 结果
     */
    @Override
    public int deletePurchaseById(Integer id)
    {
        return purchaseMapper.deletePurchaseById(id);
    }

    @Override
    public Long selOperIdByUserName(String userName) {
        return purchaseMapper.selectOperationIdByuserName(userName);
    }
}
